//
//  Number1Cell.m
//  7.13苏宁框架
//
//  Created by mini on 15/7/16.
//  Copyright (c) 2015年 lovena. All rights reserved.
//

#import "Number1Cell.h"

@implementation Number1Cell

-(instancetype)init
{
    self = [super init];
    if (self) {
        self = [[[NSBundle mainBundle]loadNibNamed:@"Number1Cell" owner:nil options:nil]lastObject];
    }
    return self;
}
- (void)awakeFromNib {
//给单元格添加手势识别器，通过手势识别器点击的位置来确定点击的是哪一个子视图
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(choose:)];
            [self addGestureRecognizer:tap];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}
//通过手势识别器点击的位置来确定点击的是哪一个子视图
-(void)choose:(UITapGestureRecognizer *)tap
{
    CGPoint point=[tap locationInView:self];
    int index=point.x/106;
    if ([self.delegate respondsToSelector:@selector(clickCell0:)]) {
        [self.delegate clickCell0:index];
    }
}
@end
